export class NetEvent {
  public static type: string = 'cocos';
  public static getEventProxy(): any {
    let eventProxy: any = null;
    switch (NetEvent.type) {
      case 'egret':
        //eventProxy=new egret.EventDispatcher();
        break;
      case 'cocos':
        eventProxy = new cc.Node();
        break;
    }
    return eventProxy;
  }
  public static createrEvent(
    type: string,
    bubbles: boolean = false,
    cancelable: boolean = false,
    data: any = null,
  ): any {
    let event: any = null;
    switch (NetEvent.type) {
      case 'egret':
        // event=new egret.Event(type,bubbles,cancelable,data);
        break;
      case 'cocos':
        event = new cc.Event.EventCustom(type, cancelable);
        if (data != null) {
          event.setUserData(data);
          event.data = data;
        }
        break;
    }
    return event;
  }
}
